<template>
  <div class="team-detail-container">
    <!-- 顶部导航 -->
    <header class="header">
      <button class="back-btn" @click="goBack">
        <span class="back-icon">‹</span>
        返回
      </button>
    </header>

    <!-- 主要内容 -->
    <main class="main-content">
      <!-- 加载状态 -->
      <div v-if="loading" class="loading-container">
        <div class="loading-spinner"></div>
        <p class="loading-text">正在加载队伍详情...</p>
      </div>

      <!-- 错误提示 -->
      <div v-else-if="errorMessage" class="error-container">
        <div class="error-icon">⚠️</div>
        <p class="error-text">{{ errorMessage }}</p>
        <button class="retry-btn" @click="retryFetchTeamDetails">重试</button>
      </div>

      <!-- 主要内容 -->
      <div v-else>
        <!-- 队伍名称 -->
        <div class="team-name-section">
          <h1 class="team-name">{{ teamInfo.teamName || '队伍' }}</h1>
        </div>

        <!-- 队伍成员 -->
        <div class="section">
          <div class="section-header">
            <h2 class="section-title-main">队伍成员</h2>
          </div>

          <div class="members-container">
            <div class="members-grid-new">
              <div v-for="member in teamMembers" :key="member.id" class="member-card-new">
                <!-- 成员头像 -->
                <div class="member-avatar-new">
                  <div class="avatar-circle-new">
                    {{ getMemberAvatarInitial(member.realName) }}
                  </div>
                </div>

                <!-- 成员信息 -->
                <div class="member-info-new">
                  <div class="member-name-new">{{ member.realName || '队员' }}</div>
                  <div class="member-role-new">{{ member.memberRole || '队员' }}</div>
                  <div class="member-college-new">{{ member.college || '暂无学院' }}</div>
                </div>

                <!-- 成员得分显示 -->
                <div class="member-score-view">
                  <div class="score-display-readonly">
                    队员得分：{{ member.score || '0' }}/20
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>

        <!-- 指导老师 -->
        <div class="section" v-if="instructorInfo">
          <div class="section-header">
            <h2 class="section-title-main">指导老师</h2>
          </div>

          <div class="teacher-container-horizontal">
            <div class="teacher-card-horizontal">
              <div class="teacher-avatar">
                <div class="avatar-circle">
                  {{ instructorAvatarInitial }}
                </div>
              </div>
              <div class="teacher-info-horizontal">
                <div class="teacher-name">{{ instructorInfo.realName || '暂无' }}</div>
                <div class="teacher-title">{{ instructorInfo.professionalTitle || '教师' }}</div>
              </div>
            </div>
          </div>
        </div>

        <!-- 入驻专家 -->
        <div class="section">
          <div class="section-header">
            <h2 class="section-title-main">入驻专家</h2>
          </div>

          <div class="experts-container-horizontal">
            <div v-if="teamExperts.length > 0" class="experts-list-horizontal">
              <div v-for="expert in teamExperts" :key="expert.id" class="expert-card-horizontal">
                <div class="expert-avatar">
                  <div class="avatar-circle">
                    {{ expert.realName ? expert.realName.charAt(0) : '专' }}
                  </div>
                </div>
                <div class="expert-info-horizontal">
                  <div class="expert-name">{{ expert.realName || '专家' }}</div>
                  <div class="expert-title">{{ expert.professionalTitle || '专家' }}</div>
                </div>
              </div>
            </div>

            <div v-else class="no-experts">
              <div class="empty-text">暂无入驻专家</div>
            </div>
          </div>
        </div>

        <!-- 操作按钮 -->
        <div class="action-section">
          <button class="action-btn primary" @click="showNotificationCenter">
            通知中心
          </button>
        </div>

        <!-- 团队介绍 -->
        <div class="section">
          <div class="section-header">
            <h3 class="section-title-info">团队介绍</h3>
          </div>
          <div class="info-content">
            <div v-if="teamInfo.teamIntro" class="info-display">
              <div class="info-item">{{ teamInfo.teamIntro }}</div>
            </div>
            <div v-else class="empty-state">
              <div class="empty-text">暂无团队介绍</div>
            </div>
          </div>
        </div>

        <!-- 当前参与的比赛 -->
        <div class="section">
          <div class="section-header">
            <h3 class="section-title-info">当前参与的比赛</h3>
          </div>
          <div class="info-content">
            <div v-if="currentCompetitions.length > 0" class="info-display">
              <div v-for="(competition, index) in currentCompetitions" :key="index" class="info-item">
                {{ competition }}
              </div>
            </div>
            <div v-else class="empty-state">
              <div class="empty-text">暂无参与的比赛信息</div>
            </div>
          </div>
        </div>

        <!-- 获奖情况 -->
        <div class="section">
          <div class="section-header">
            <h3 class="section-title-info">获奖情况</h3>
          </div>
          <div class="info-content">
            <div v-if="awards.length > 0" class="info-display">
              <div v-for="(award, index) in awards" :key="index" class="info-item">
                {{ award }}
              </div>
            </div>
            <div v-else class="empty-state">
              <div class="empty-text">暂无获奖信息</div>
            </div>
          </div>
        </div>

        <!-- 队伍基本信息 -->
        <div class="team-meta-simple">
          <span class="meta-info">队伍编号：{{ teamInfo.teamCode || '自动生成' }}</span>
          <span class="meta-separator">|</span>
          <span class="meta-info">组建时间：{{ formatDate(teamInfo.createTime) }}</span>
        </div>
      </div>
    </main>

    <!-- 消息提示弹窗 -->
    <div v-if="showMessageModal" class="modal-overlay" @click="closeMessageModal">
      <div class="modal-content" @click.stop>
        <div class="modal-header error-header">
          <h3>加载失败</h3>
          <button class="close-btn" @click="closeMessageModal">×</button>
        </div>
        <div class="modal-body">
          <div class="icon-wrapper">
            <div class="message-icon error-icon">✗</div>
          </div>
          <p class="modal-text">{{ errorMessage }}</p>
        </div>
        <div class="modal-footer">
          <button class="confirm-btn" @click="closeMessageModal">确定</button>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { computed, ref, onMounted } from 'vue'
import { useRouter, useRoute } from 'vue-router'
import { useTokenStore } from '@/stores/token.js'
import { getTeamDetailService } from '@/api/team.js'

const router = useRouter()
const route = useRoute()
const tokenStore = useTokenStore()

// 数据加载状态
const loading = ref(false)

// 消息提示弹窗控制
const showMessageModal = ref(false)
const errorMessage = ref('')

// 队伍信息数据
const teamInfo = ref({})
const instructorInfo = ref(null)
const teamMembers = ref([])
const teamExperts = ref([])
const awards = ref([])
const currentCompetitions = ref([])

// 队伍头像首字母
const teamAvatarInitial = computed(() => {
  if (loading.value) return '...'
  const name = teamInfo.value?.teamName || '队伍'
  return name.charAt(0)
})

// 指导教师头像首字母
const instructorAvatarInitial = computed(() => {
  if (!instructorInfo.value) return '师'
  const name = instructorInfo.value.realName || '教师'
  return name.charAt(0)
})

// 页面挂载时获取队伍信息
onMounted(async () => {
  // 检查登录状态
  if (!tokenStore.token) {
    router.push('/login')
    return
  }

  const teamId = route.params.teamId
  if (teamId) {
    await fetchTeamDetail(teamId)
  } else {
    showErrorMessage('队伍ID参数缺失')
  }
})

// 获取队伍详细信息
const fetchTeamDetail = async (teamId) => {
  loading.value = true
  try {
    console.log('获取队伍详情，teamId:', teamId)
    const result = await getTeamDetailService(teamId)
    console.log('队伍详情API响应:', result)
    
    if (result.code === 200) {
      const data = result.data
      
      // 设置队伍基本信息
      teamInfo.value = {
        teamId: data.teamId,
        teamName: data.teamName,
        teamCode: data.teamCode,
        teamType: data.teamType,
        teamIntro: data.teamIntro,
        currentCompetition: data.currentCompetition,
        createTime: data.createTime,
        updateTime: data.updateTime
      }
      
      // 设置指导教师信息
      instructorInfo.value = data.instructor || null
      
      // 设置队伍成员信息
      teamMembers.value = data.members || []
      
      // 设置入驻专家信息
      teamExperts.value = data.experts || []
      
      // 设置获奖信息
      if (data.awardInfo) {
        awards.value = data.awardInfo.split(';').filter(award => award.trim())
      } else {
        awards.value = []
      }
      
      // 设置当前参赛信息
      if (data.currentCompetition) {
        currentCompetitions.value = data.currentCompetition.split(';').filter(comp => comp.trim())
      } else {
        currentCompetitions.value = []
      }
      
      console.log('队伍信息加载成功:', teamInfo.value?.teamName)
    } else {
      console.error('获取队伍详情失败:', result.msg)
      showErrorMessage(result.msg || '获取队伍详情失败')
    }
  } catch (error) {
    console.error('获取队伍详情异常:', error)
    showErrorMessage('获取队伍详情时发生错误')
  } finally {
    loading.value = false
  }
}

// 返回上一页
const goBack = () => {
  router.go(-1)
}

// 处理个人中心点击
const handleProfileClick = () => {
  router.push('/profile')
}

// 显示错误消息
const showErrorMessage = (text) => {
  errorMessage.value = text
  showMessageModal.value = true
}

// 关闭消息弹窗
const closeMessageModal = () => {
  showMessageModal.value = false
}

// 获取成员头像首字母
const getMemberAvatarInitial = (name) => {
  if (!name) return '员'
  return name.charAt(0)
}

// 获取角色样式类
const getRoleClass = (role) => {
  if (role === '队长') return 'role-leader'
  if (role === '副队长') return 'role-vice-leader'
  return 'role-member'
}

// 格式化时间
const formatTime = (timeString) => {
  if (!timeString) return '暂无'
  const date = new Date(timeString)
  return date.toLocaleString('zh-CN', {
    year: 'numeric',
    month: '2-digit',
    day: '2-digit',
    hour: '2-digit',
    minute: '2-digit'
  })
}

// 格式化日期（队伍底部信息使用）
const formatDate = (dateString) => {
  if (!dateString) return '暂无'
  const date = new Date(dateString)
  return `${date.getFullYear()}年${String(date.getMonth() + 1).padStart(2, '0')}月${String(date.getDate()).padStart(2, '0')}日`
}

// 显示通知中心
const showNotificationCenter = () => {
  console.log('跳转到通知中心')
  const teamId = route.params.teamId
  if (!teamId) {
    showErrorMessage('队伍ID信息缺失')
    return
  }
  
  // 跳转到通知中心页面
  router.push({
    name: 'NotificationCenter',
    params: { teamId: teamId }
  })
}

// 重试获取队伍详情
const retryFetchTeamDetails = () => {
  const teamId = route.params.teamId
  if (teamId) {
    fetchTeamDetail(teamId)
  }
}
</script>

<style scoped>
/* 导入教师端相同的样式 */
.team-detail-container {
  min-height: 100vh;
  background: linear-gradient(180deg, #6c63ff 0%, #5847e0 30%, #e8e6f8 60%, #ffffff 100%);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 20px 25px;
  background: transparent;
  z-index: 100;
}

.back-btn {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 10px 18px;
  border-radius: 25px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(10px);
}

.back-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.back-icon {
  font-size: 20px;
  font-weight: bold;
}

.main-content {
  padding: 100px 25px 30px;
  max-width: 1000px;
  margin: 0 auto;
}

.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 100px 20px;
  color: white;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

.loading-text {
  font-size: 18px;
  color: white;
  opacity: 0.9;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.error-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 100px 20px;
  color: white;
  text-align: center;
}

.error-icon {
  font-size: 64px;
  margin-bottom: 20px;
  opacity: 0.8;
}

.error-text {
  font-size: 18px;
  margin-bottom: 30px;
  opacity: 0.9;
  line-height: 1.6;
}

.retry-btn {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 12px 30px;
  border-radius: 25px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.retry-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

/* 队伍名称 */
.team-name-section {
  text-align: center;
  margin-bottom: 40px;
}

.team-name {
  font-size: 32px;
  font-weight: 700;
  color: white;
  margin: 0;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* 队伍成员容器 */
.members-container {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 25px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
  margin: 0 auto 30px auto;
  width: 100%;
  max-width: 800px;
}

/* 队伍成员网格布局 */
.members-grid-new {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 2px;
}

.member-card-new {
  background: transparent;
  border-radius: 15px;
  padding: 20px;
  text-align: center;
  border: 1px solid rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.member-card-new:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(108, 99, 255, 0.3);
}

.member-avatar-new {
  margin-bottom: 15px;
}

.avatar-circle-new {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6c63ff 0%, #5847e0 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: bold;
  margin: 0 auto;
  box-shadow: 0 4px 15px rgba(108, 99, 255, 0.4);
}

.member-info-new {
  margin-bottom: 15px;
}

.member-name-new {
  font-size: 18px;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 8px;
}

.member-role-new {
  font-size: 14px;
  color: #7c3aed;
  font-weight: 500;
  background: rgba(124, 58, 237, 0.1);
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  margin-bottom: 8px;
}

.member-college-new {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 15px;
}

.member-score-view {
  margin-top: 15px;
}

.score-display-readonly {
  font-size: 13px;
  color: #059669;
  background: rgba(5, 150, 105, 0.1);
  padding: 6px 12px;
  border-radius: 15px;
  display: inline-block;
  font-weight: 500;
}

/* 区域标题样式 */
.section {
  margin-bottom: 40px;
}

.section-header {
  margin-bottom: 25px;
  text-align: center;
}

.section-title-main {
  font-size: 24px;
  font-weight: 600;
  color: white;
  margin: 0;
  position: relative;
  display: inline-block;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.section-title-main::before,
.section-title-main::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40px;
  height: 2px;
  background: rgba(255, 255, 255, 0.6);
}

.section-title-main::before {
  left: -60px;
}

.section-title-main::after {
  right: -60px;
}

/* 信息类区域标题样式（灰色） */
.section-title-info {
  font-size: 24px;
  font-weight: 600;
  color: #6b7280;
  margin: 0;
  position: relative;
  display: inline-block;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.section-title-info::before,
.section-title-info::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40px;
  height: 2px;
  background: rgba(107, 114, 128, 0.4);
}

.section-title-info::before {
  left: -60px;
}

.section-title-info::after {
  right: -60px;
}

/* 指导教师和专家样式 */
.teacher-container-horizontal,
.experts-container-horizontal {
  display: flex;
  justify-content: center;
  margin: 0 auto 30px auto;
  width: 100%;
  max-width: 800px;
}

.teacher-card-horizontal,
.expert-card-horizontal {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 25px 30px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
  min-width: 300px;
}

.teacher-avatar,
.expert-avatar {
  flex-shrink: 0;
}

.avatar-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: bold;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.teacher-info-horizontal,
.expert-info-horizontal {
  flex: 1;
}

.teacher-name,
.expert-name {
  font-size: 20px;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 5px;
}

.teacher-title,
.expert-title {
  font-size: 16px;
  color: #6b7280;
}

.experts-list-horizontal {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.no-experts {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 40px;
  text-align: center;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
}

.empty-text {
  font-size: 16px;
  color: #6b7280;
  font-style: italic;
}

/* 操作按钮 */
.action-section {
  text-align: center;
  margin-bottom: 40px;
}

.action-btn {
  background: linear-gradient(135deg, #ff8c00 0%, #ff7700 100%);
  color: white;
  border: none;
  padding: 15px 60px;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 8px 25px rgba(255, 140, 0, 0.4);
  width: 100%;
  max-width: 300px;
}

.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(255, 140, 0, 0.5);
}

/* 信息内容 */
.info-content {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 25px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
}

.info-display {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.info-item {
  font-size: 16px;
  line-height: 1.6;
  color: #374151;
  padding: 15px;
  background: rgba(248, 250, 252, 0.8);
  border-radius: 12px;
  border-left: 4px solid #6c63ff;
}

.empty-state {
  text-align: center;
  padding: 30px;
}

/* 队伍基本信息 */
.team-meta-simple {
  text-align: center;
  padding: 20px;
  margin-top: 30px;
}

.meta-info {
  font-size: 14px;
  color: #6b7280;
  font-weight: 500;
}

.meta-separator {
  margin: 0 15px;
  color: #d1d5db;
}

/* 弹窗样式 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease-out;
}

.modal-content {
  background: white;
  border-radius: 20px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  animation: slideIn 0.3s ease-out;
  position: relative;
  overflow: hidden;
}

.modal-header {
  background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
  color: white;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.3s ease;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.modal-body {
  padding: 30px 20px;
  text-align: center;
}

.icon-wrapper {
  margin-bottom: 20px;
}

.message-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 30px;
  font-weight: bold;
  margin: 0 auto;
  background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
}

.modal-text {
  font-size: 18px;
  color: #333;
  margin: 0 0 10px 0;
  font-weight: 600;
}

.modal-footer {
  padding: 0 20px 20px;
  display: flex;
  gap: 12px;
  justify-content: center;
}

.confirm-btn {
  flex: 1;
  max-width: 120px;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #6c63ff;
  color: white;
  border: none;
}

.confirm-btn:hover {
  background: #5847e0;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(108, 99, 255, 0.3);
}

/* 动画效果 */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: scale(0.7);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* 移动端适配 */
@media (max-width: 768px) {
  .header {
    padding: 15px 20px;
  }
  
  .main-content {
    padding: 80px 20px 30px;
  }
  
  .team-name {
    font-size: 28px;
  }
  
  .members-container {
    width: 90%;
    max-width: none;
  }
  
  .members-grid-new {
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
  }
  
  .member-card-new {
    padding: 10px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
  }
  
  .section-title-main {
    font-size: 20px;
  }
  
  .section-title-main::before,
  .section-title-main::after {
    width: 30px;
  }
  
  .section-title-main::before {
    left: -45px;
  }
  
  .section-title-main::after {
    right: -45px;
  }
  
  .section-title-info {
    font-size: 20px;
  }
  
  .section-title-info::before,
  .section-title-info::after {
    width: 30px;
  }
  
  .section-title-info::before {
    left: -45px;
  }
  
  .section-title-info::after {
    right: -45px;
  }
  
  .teacher-container-horizontal{
    width: 90%;
    max-width: none;
    margin: 0 auto;
  }
  

  .experts-container-horizontal {
    width: 90%;
    max-width: none;
    margin: 0 auto;
  }

  .teacher-card-horizontal {
    flex-direction: column;
    text-align: center;
    gap: 15px;
    min-width: auto;
    width: 100%;
    padding: 20px;
  }

  .expert-card-horizontal {
    flex-direction: column;
    text-align: center;
    gap: 15px;
    min-width: auto;
    width: 100%;
    padding: 20px;
  }
  
  .action-btn {
    padding: 12px 30px;
    font-size: 16px;
    max-width: none;
  }
  
  .info-content {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .header {
    padding: 12px 15px;
  }
  
  .back-btn {
    padding: 8px 15px;
    font-size: 14px;
  }
  
  .main-content {
    padding: 70px 15px 25px;
  }
  
  .team-name {
    font-size: 24px;
  }
  
  .members-container {
    padding: 15px 10px;
    width: 95%;
  }
  
  .member-card-new {
    padding: 8px;
  }
  
  .avatar-circle-new,
  .avatar-circle {
    width: 50px;
    height: 50px;
    font-size: 18px;
  }
  
  .section-title-main,
  .section-title-info {
    font-size: 18px;
  }
  
  .section-title-main::before,
  .section-title-main::after,
  .section-title-info::before,
  .section-title-info::after {
    display: none;
  }
  
  .teacher-container-horizontal{
    width: 95%;
  }


  .experts-container-horizontal{
    width: 95%;
  }
  
  .teacher-card-horizontal {
    padding: 15px;
  }

  
  .expert-card-horizontal{
    padding: 15px;
  }
  
  .action-btn {
    font-size: 16px;
    padding: 12px 20px;
  }
  
  .modal-content {
    width: 95%;
    margin: 20px;
  }
  
  .modal-header {
    padding: 15px;
  }
  
  .modal-header h3 {
    font-size: 16px;
  }
  
  .modal-body {
    padding: 25px 15px;
  }
  
  .modal-text {
    font-size: 16px;
  }
  
  .confirm-btn {
    padding: 10px 15px;
    font-size: 14px;
  }
}
</style>